<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class mod_telco extends CI_Model {
    
    function __construct()
    {
        parent::__construct();
    }

    public function insert_telco()
    {
        $data['nombre'] = $this->input->post('nombre');
        $this->db->insert('telco',$data);                        
    }
    
    public function update_telco()
    {
        $data['nombre'] = $this->input->post('nombre');
        $this->db->where('telco.id_telco',$this->input->post('id_telco'));
        $this->db->update('telco',$data);	
    }
    
    public function delete_telco($id_telco)
    {
        $this->db->where('telco.id_telco',$id_telco );
        $this->db->delete('telco');
    }
    
    public function carga_tabla()
    {          
       	return $this->db->query("
            SELECT telco.id_telco, 
                telco.nombre
            FROM
                telco");   
    }
    
    public function carga_datos($id_telco)
    {          
       	return $this->db->query("
            SELECT telco.id_telco, 
                telco.nombre
            FROM
                telco
            WHERE telco.id_telco='".$id_telco."' LIMIT 1");   
    }
}